#include<iostream>
#include<string>
#include<gtest/gtest.h>
#include<unordered_map>


class MySuit :public testing::Test{
public:
    virtual void SetUp()
    {
        std::cout<<"测试前构建"<<std::endl;
        _dirt.insert(std::make_pair("apple","苹果"));
        _dirt.insert(std::make_pair("word","单词"));
    }

    virtual void TearDown()
    {
        std::cout<<"测试结束,清理工作"<<std::endl;
        _dirt.clear();
    }

public:
    std::unordered_map<std::string,std::string> _dirt;
};

//这里要指定名称了!!
TEST_F(MySuit,test_insert)
{
    _dirt.insert(std::make_pair("list","清单"));
    _dirt.insert(std::make_pair("map","地图"));
    auto it =_dirt.find("map");
    ASSERT_NE(it,_dirt.end());
    _dirt.insert(std::make_pair("insert","插入"));
}

TEST_F(MySuit,test_size)
{
    EXPECT_EQ(_dirt.size(),4);
    EXPECT_EQ(_dirt.size(),5);

    ASSERT_GT(_dirt.size(), 0);
}


int main(int argc,char*argv[])
{
    testing::InitGoogleTest(&argc,argv);
    RUN_ALL_TESTS();
    return 0;
}